#include<stdlib.h>
#include<stdio.h>
#include<string.h>
char str[500];
int vis[500];

int main(void) {
	scanf("%s", &str);
	int len = strlen(str);
	int i;
	for (i = 0; i < len - 1; i++) {
		if (str[i] == str[i+1] || (str[i] + 1) == str[i+1] || (str[i] - 1) == str[i+1]) {
			vis[i] = 1;
			vis[i+1] = 1;
		} 
	}
	int sum = 0;
	for (i = 0; i < len; i++) {
		if (vis[i]) {
			sum += (int)(str[i] - 'a' + 1);
		}
	}
	printf("%d\n", sum);
	return 0;
} 
